package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

import java.util.Map;

@Service
public class HelloServiceImpl   implements HelloService {
    @Override
    public String sayHello(String name) {
        try {
            //Thread.sleep(3000);
            //获取传递过来的参数
            String ip = RpcContext.getContext().getAttachment("ip");
            System.out.println("ip为：：："+ip);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "hello:"+name;
    }
}
